package mxmf.entity;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import chances.smart.commons.jpa.annotation.DTOAttribute;

@MappedSuperclass
public class CmsEntity implements Serializable {

    public static final List<String> cmsEntities = Arrays.asList("movie", "series", "link",
            "imagetxt", "subject", "series2", "album", "column", "channel", "schedule", "episode",
            "episode2");
    public static final List<String> cpEntities = Arrays.asList("movie", "series", "series2",
            "episode", "episode2");

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    protected Long id;

    @Column(name = "CREATE_TIME")
    protected Date createTime;

    @Column(name = "UPDATE_TIME")
    protected Date updateTime;

    @Column(name = "CREATER_ID", length = 20)
    protected String createrId;

    @Column(name = "UPDATER_ID", length = 20)
    protected String updaterId;

    @Column(name = "EXTERNAL_CODE", length = 128)
    @DTOAttribute(insert = true, update = false)
    protected String externalCode;//

    @Enumerated(EnumType.ORDINAL)
    @Column(name = "STATUS", length = 2)
    protected Integer status;

    @Column(name = "EXTERNAL_Id")
    protected Long externalId;// 数据同步使用

    public CmsEntity() {
        this.createTime = new Date();
    }

    /**
     * @return the createTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @param createTime
     *            the createTime to set
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * @return the updateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * @param updateTime
     *            the updateTime to set
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * @return the createrId
     */
    public String getCreaterId() {
        return createrId;
    }

    /**
     * @param createrId
     *            the createrId to set
     */
    public void setCreaterId(String createrId) {
        this.createrId = createrId;
    }

    /**
     * @return the updaterId
     */
    public String getUpdaterId() {
        return updaterId;
    }

    /**
     * @param updaterId
     *            the updaterId to set
     */
    public void setUpdaterId(String updaterId) {
        this.updaterId = updaterId;
    }

    /**
     * @return the externalCode
     */
    public String getExternalCode() {
        return externalCode;
    }

    /**
     * @param externalCode the externalCode to set
     */
    public void setExternalCode(String externalCode) {
        this.externalCode = externalCode;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * @return the externalId
     */
    public Long getExternalId() {
        return externalId;
    }

    /**
     * @param externalId the externalId to set
     */
    public void setExternalId(Long externalId) {
        this.externalId = externalId;
    }

}
